package com.whmnx.main.ui.model;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.whmnx.base.bean.VideoBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

/**
 * author : huang
 * date   : 2020/9/28 0028 19:21
 * version: 1.0
 * @author Administrator
 */
public class WorkItemViewModel3 extends ItemViewModel {

    public ObservableField<String> tvNum = new ObservableField<>("");

    public String imgUrl;
    BaseViewModel viewModel;
    int position ;
    VideoBean videoBean;
    public WorkItemViewModel3(@NonNull BaseViewModel viewModel, VideoBean videoBean, int i) {
        super(viewModel);
        this.viewModel = viewModel;
        this.videoBean = videoBean;
        this.position = i;
        if (TextUtils.isEmpty(videoBean.getWork_Image())){
            this.imgUrl = videoBean.getWork_Vidoe();
        }else {
            this.imgUrl = videoBean.getWork_Image();
        }
        tvNum.set(videoBean.playNum);
    }

    //播豆
    public BindingCommand OnClickCommand = new BindingCommand(new BindingAction() {
        @Override
        public void call() {

        }
    });
}
